#ifndef __BLDC_H
#define __BLDC_H
#include "main.h"



#define DR_GPIO_PIN        	GPIO_PIN_7                  
#define DR_GPIO_PORT      	CW_GPIOB               
            
#define PWM_AP_PORT									(CW_GPIOB)
#define PWM_AP_PIN									(GPIO_PIN_0)
#define PWM_AN_PORT									(CW_GPIOA)
#define PWM_AN_PIN									(GPIO_PIN_2)

#define PWM_BP_PORT									(CW_GPIOB)
#define PWM_BP_PIN									(GPIO_PIN_1)
#define PWM_BN_PORT									(CW_GPIOB)
#define PWM_BN_PIN									(GPIO_PIN_3)

#define PWM_CP_PORT									(CW_GPIOA)
#define PWM_CP_PIN									(GPIO_PIN_3)
#define PWM_CN_PORT									(CW_GPIOA)
#define PWM_CN_PIN									(GPIO_PIN_6)
#define PWM_PERIOD 2399 

#define PWM_AL_OFF GPIO_WritePin(PWM_AN_PORT,PWM_AN_PIN,GPIO_Pin_RESET) 
#define PWM_BL_OFF GPIO_WritePin(PWM_BN_PORT,PWM_BN_PIN,GPIO_Pin_RESET) 
#define PWM_CL_OFF GPIO_WritePin(PWM_CN_PORT,PWM_CN_PIN,GPIO_Pin_RESET) 

#define PWM_AL_ON GPIO_WritePin(PWM_AN_PORT,PWM_AN_PIN,GPIO_Pin_SET)
#define PWM_BL_ON GPIO_WritePin(PWM_BN_PORT,PWM_BN_PIN,GPIO_Pin_SET)
#define PWM_CL_ON GPIO_WritePin(PWM_CN_PORT,PWM_CN_PIN,GPIO_Pin_SET)
#endif